#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isPalindrome(int x) {
        if (x < 0)
            return false;
        if (x == 0)
            return true;
        string s1;
        int dev = x;
        while (dev != 0)
        {
            s1 += (dev % 10 + '0');
            dev /= 10;
        }
        auto it1 = s1.begin();
        auto it2 = s1.end() - 1;
        while (it1 < it2)
        {
            if (*it1 == *it2)
            {
                ++it1;
                --it2;
            }
            else
            {
                return false;
            }
        }
        return true;
    }
};